package net.cyndeline.components.objectProperties

import net.cyndeline.entitySystem.Component
import net.cyndeline.GUI.GameObjectKey
import net.cyndeline.GUI.MapLayer
import net.cyndeline.GUI.Agent

/**
 * Stores a key that lets the map-drawing logic determine what type
 * of object this is, and what kind of graphical representation to
 * use for it.
 */
trait MapKeyComponent extends Component {
  
  /** 
   * The type of visual representation this entity should have on
   * the map.
   */ 
  def key: String
  
  /**
   * Which rendering layer it should be drawn to.
   * 
   * @see net.cyndeline.GUI.MapModifier
   */
  def layer: MapLayer
  
  /**
   * If the entity should be drawn.
   * 
   * @return True if the entity should be drawn, otherwise false.
   */
  def renderable: Boolean
}
class MapKey extends MapKeyComponent {
  var key = GameObjectKey.default
  var layer: MapLayer = Agent
  var renderable = true
  
  override def copy = {
    val copy = new MapKey()
    copy.key = key
    copy
  }
}